﻿<UserControl x:Class="Spenta.StreetCare.Silverlight.UserControls.ReportBubbleUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:ViewModels="clr-namespace:Spenta.StreetCare.Silverlight.MVVM.ViewModels" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <ViewModels:ReportBubbleViewModel x:Name="ReportBubbleViewModel" />
    </UserControl.Resources>

    <StackPanel Style="{StaticResource BubbleBackStackPanel}" DataContext="{StaticResource ReportBubbleViewModel}">
        <StackPanel Style="{StaticResource BubbleStackPanel}">
            <Grid Margin="10,5">
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition Width="0.956*"/>
            		<ColumnDefinition Width="0.044*"/>
            	</Grid.ColumnDefinitions>
        		<HyperlinkButton Content="{Binding Report.Category.CategoryTitle}" Margin="0" Style="{StaticResource ReportLink}">
        			<i:Interaction.Triggers>
        				<i:EventTrigger EventName="Click">
        					<cmd:EventToCommand Command="{Binding OpenReportCommand, Mode=OneWay}"/>
        				</i:EventTrigger>
        			</i:Interaction.Triggers>
        		</HyperlinkButton>
        		<Button Style="{StaticResource BaseButton}" Content="x" VerticalAlignment="Top" Grid.Column="1" Margin="4,0,0,0" Width="22">
        			<i:Interaction.Triggers>
        				<i:EventTrigger EventName="Click">
        					<cmd:EventToCommand Command="{Binding CloseBubbleCommand, Mode=OneWay}"/>
        				</i:EventTrigger>
        			</i:Interaction.Triggers>
        		</Button>
        	</Grid>
            <StackPanel Margin="15,0" Orientation="Horizontal">
            	<ContentControl Template="{StaticResource UnfixedImage}" Content="{Binding Report.ReportImageUrl}" Width="100" Height="85"  Visibility="{Binding Report.ReportImageVisible, Converter={StaticResource VisibilityToBoolConverter}}"/>
                <ContentControl Template="{StaticResource FixedImage}" Content="{Binding Report.ReportFixedImageUrl}" Margin="15,0,0,0" Width="100" Height="85"  Visibility="{Binding Report.ReportFixedImageVisible, Converter={StaticResource VisibilityToBoolConverter}}" />

            </StackPanel>
            <StackPanel Margin="15,0,15,15" Orientation="Horizontal">
                <StackPanel Margin="0,0,20,0">
                    <StackPanel x:Name="stackPanel1" Orientation="Horizontal" Margin="0,5,0,0">
                        <dataInput:Label Content="{Binding Literals.Reported}" Style="{StaticResource ReportedByLabel}" />
                        <dataInput:Label Content="{Binding Report.ReportWhen, Converter={StaticResource DateConverter}}" Style="{StaticResource ReportedByLabel}" />
                        <dataInput:Label Content="{Binding Literals.By}" Style="{StaticResource ReportedByLabel}" />
                        <dataInput:Label Content="{Binding Report.User.UserNickname}" Style="{StaticResource ReportedByLabel}" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Margin="0,5,0,0">
                    <dataInput:Label Content="{Binding Literals.Rate}" Style="{StaticResource ReportedByLabel}" />
                    <inputToolkit:Rating Style="{StaticResource RatingStarsStyle}" ItemContainerStyle="{StaticResource RatingStyle}" Value="{Binding Report.ReportRating}" Background="Transparent" BorderBrush="Black"  ItemCount="5" SelectionMode="Continuous" Width="100" d:LayoutOverrides="VerticalAlignment" IsReadOnly="True" />
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </StackPanel>
</UserControl>
